﻿using Microsoft.AspNetCore.Authorization;

namespace CustomAuthorization.MinimumAgeAuthorize
{
    public class MinimumAgeAuthorizeAttribute:AuthorizeAttribute, IAuthorizationRequirement,IAuthorizationRequirementData
    {
        public int MinimumAge { get; }
        public MinimumAgeAuthorizeAttribute(int minimumAge)
        {
            MinimumAge = minimumAge;
        }

        public IEnumerable<IAuthorizationRequirement> GetRequirements()
        {
            yield return this;
        }
    }
}
